package online.cmagic.structureType.decorator;

/**
 * @author wsc
 * @date: 2020年04月14日 17:20
 * @since JDK 1.8
 */
public interface Animal {
    void kinds();
}

class Dog implements Animal{

    public void kinds(){
        System.out.println("Kinds: Dog");
    }
}
class Cat implements Animal{

    public void kinds() {
        System.out.println("Kinds: Cat");
    }
}

class DecorateAnimal implements Animal{

    protected Animal decorateAnimal;

    public DecorateAnimal(Animal decorateAnimal){
        this.decorateAnimal = decorateAnimal;
    }

    public void kinds() {
        decorateAnimal.kinds();
    }
}

class WriteDecorateAnimal extends DecorateAnimal{


    public WriteDecorateAnimal(Animal decorateAnimal) {
        super(decorateAnimal);
    }

    public void kinds(){
        decorateAnimal.kinds();
        SetColor(decorateAnimal);
    }

    public void SetColor(Animal decorateAnimal){
        System.out.println("Color: Write");
    }
}